/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package AnalysistImpl;

import AnalysistInterface.IAnalysist;
import AnalysistInterface.IManagerAnalysist;
import DTO.DrawDTO;
import DTO.PacketDTO;
import java.util.Date;
import java.util.HashMap;

/**
 *
 * @author Administrator
 */
public class ManagerAnalysist implements IManagerAnalysist {

    private HashMap<String, IAnalysist> AnalysistMap = new HashMap<String, IAnalysist>();
    private HashMap<String, PacketDTO> AnalysistResult = new HashMap<String, PacketDTO>();

    @Override
    public void installNewAnalysist(IAnalysist ia) {
        AnalysistMap.put(ia.getAnalysistSign(), ia);
    }

    @Override
    public void unInstallAnalysist(String sign) {
        AnalysistMap.remove(sign);
    }

    @Override
    public DrawDTO analysisReport(String SensorSign, String Location, PacketDTO _packet) {
        IAnalysist ia = AnalysistMap.get(SensorSign);
        return ia.analysis(Location, _packet);
    }

    @Override
    public DrawDTO analysisReport(String SensorSign, String Location, Date fromDate, Date toDate, PacketDTO _packet) {
        IAnalysist ia = AnalysistMap.get(SensorSign);
        return ia.analysis(Location,_packet,fromDate,toDate);
    }

    public HashMap<String, IAnalysist> getAnalysistMap() {
        return AnalysistMap;
    }

    public void setAnalysistMap(HashMap<String, IAnalysist> AnalysistMap) {
        this.AnalysistMap = AnalysistMap;
    }
}
